﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using System.Data;

namespace Data
{
    public class ATMData
    {
         Connect cn = new Connect();

        public ATMsEntity GetATM(int aID)
        {
            int Npara = 1;
            string[] name = new string[Npara];
            object[] value = new object[Npara];
            name[0] = "@ATMID"; value[0] = aID;
            string sql = "dbo.ATMsSelectByID";
            DataTable dt = cn.GetData(sql, name, value, Npara);
            ATMsEntity aE = new ATMsEntity
            {
                ATMID = (int)dt.Rows[0][0],
                Branch = dt.Rows[0][1].ToString(),
                ATMAddress = dt.Rows[0][2].ToString()
            };
            return aE;
        }
    
    }
}
